<?php
add_action('admin_menu','AdminSubMenu');
/**
 * Create a admin menu name Hoa don
 */
function AdminSubMenu()
{
	add_menu_page(__("Edit Cache",WS24_THEMENAME), __("Edit Cache",WS24_THEMENAME), "administrator", "edit-cache",'ws24_theme_func_edit_cache','','115');
}

function ws24_theme_func_edit_cache ()
{
	global $wpdb;

	?>
	<div class="">
		<?php 
		if($_SERVER['REQUEST_METHOD']=='POST')
		{
			if(wp_verify_nonce($_POST['act_reset_all_cache'],'act_reset_all_cache'))
			{
				$wpdb->query(
						$wpdb->prepare(
								"
								DELETE FROM $wpdb->options
								WHERE option_name LIKE  %s
								",
								'_transient_mycache_transient_'.'%'
						)
					);

				echo 'Xóa toàn bộ cache thành công!';
			}	
		}
		?>
		<form action="" method="post">
			<input type="submit" name="reset_all_cache" value="Reset cache">
			<?php wp_nonce_field('act_reset_all_cache','act_reset_all_cache');?>
		</form>
	</div>
<?php 
}